srcdir=         @srcdir@
top_srcdir=     @top_srcdir@
top_builddir=   @top_builddir@
VPATH=          @srcdir@

include ${top_builddir}/Mk/autoconf.mk
include ${top_builddir}/Mk/compile.mk


TEST_OBJS= \
		tests.o \
		S3AccountTests.o \
		S3AtomicTests.o \
		S3AutoreleasePoolTests.o \
		S3ConnectionTests.o \
		S3DictTests.o \
		S3ErrorTests.o \
		S3LibTests.o \
		S3ListTests.o \
		S3RequestTests.o \
		S3StringTests.o \
		S3StringBuilderTests.o \
		base64tests.o

CFLAGS+=	@CHECK_CFLAGS@ $(LIBCURL_CFLAGS) $(XML_CFLAGS) $(OPENSSL_CFLAGS) -DTEST_DATA=\"${srcdir}/data\"
LIBS+=		-ls3-testing $(LIBCURL_LDFLAGS) $(XML_LDFLAGS) $(OPENSSL_LDFLAGS) @CHECK_LIBS@
LDFLAGS+=	-L${top_builddir}/src $(LIBS)

# Recompile the tests every time
all: tests

tests: ${TEST_OBJS} ../src/libs3-testing.a
	${CC} -o $@ ${TEST_OBJS} ${LDFLAGS}

test:: tests
	./tests

install::

clean::
	rm -f $(TEST_OBJS) tests

distclean:: clean
	rm -f Makefile
